package com.wn.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author yellow Docter
 * @since 2022-05-20
 */
public class House implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer storey;

    private String numbers;

    private Integer status;

    // 房子里面有一个 户主
    @TableField(exist = false)
    private Owner owner;

    public Owner getOwner() {
        return owner;
    }

    public void setOwner(Owner owner) {
        this.owner = owner;
    }

    /**
     *  java 中是驼峰命名
     *  mysql中 是 into_date
     *
     * 日期的格式化
     *  @JsonFormat(pattern = "yyyy-MM-dd") 通过json 输出指定的日期格式化
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date intoDate;

    private Integer buildingId;

    private String remarks;

    private Double area;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getStorey() {
        return storey;
    }

    public void setStorey(Integer storey) {
        this.storey = storey;
    }
    public String getNumbers() {
        return numbers;
    }

    public void setNumbers(String numbers) {
        this.numbers = numbers;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getIntoDate() {
        return intoDate;
    }

    public void setIntoDate(Date intoDate) {
        this.intoDate = intoDate;
    }

    public Integer getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(Integer buildingId) {
        this.buildingId = buildingId;
    }
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    public Double getArea() {
        return area;
    }

    public void setArea(Double area) {
        this.area = area;
    }

    @Override
    public String toString() {
        return "House{" +
            "id=" + id +
            ", storey=" + storey +
            ", numbers=" + numbers +
            ", status=" + status +
            ", intoDate=" + intoDate +
            ", buildingId=" + buildingId +
            ", remarks=" + remarks +
            ", area=" + area +
        "}";
    }
}
